<!DOCTYPE html>
<html lang="en">

<head>
    <!-- BEGIN META -->
    {include file="public/meta"}
    <!-- END META -->

    <!-- BEGIN STYLESHEET-->
    {include file="public/css"}
    <!-- END STYLESHEET-->

    <title>
        {$current_menu['title']} - {$yun_config.title}
    </title>
</head>

<body>
<!-- BEGIN SECTION -->
<section id="container">
    <!-- BEGIN HEADER -->
    {include file="public/header"}
    <!-- END HEADER -->
    <!-- BEGIN SIDEBAR -->
    {include file="public/sidebar"}
    <!-- END SIDEBAR -->
    <!-- BEGIN MAIN CONTENT -->
    <section id="main-content">
        <!-- BEGIN WRAPPER  -->
        <section class="wrapper z-index-1">
            <!-- TOP MENU ROW  -->
            {include file="public/top_menu"}
            <!-- TOP MENU ROW  -->

            <!-- BEGIN ROW  -->
            <div class="row">
                <div class="col-lg-12">
                    <section class="panel-bg">
                        <header class="panel-heading">
                            <span class="label label-primary">{$current_menu.title}</span>
                        </header>
                        <div class="panel-body">
                            <div class="form">
                                <form class="cmxform form-horizontal tasi-form" id="authGroupAddForm" method="post"
                                      action="{:url('save')}">
                                    <div class="form-group">
                                        <label for="title" class="control-label col-sm-2">角色名称</label>
                                        <div class="col-sm-3">
                                            <input class="form-control bg-white" id="title" name="title" type="text"
                                                   value="">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="status" class="control-label col-sm-2">角色状态</label>
                                        <div class="col-sm-3">
                                            <input class="form-control" id="status" name="status" type="checkbox"
                                                   data-toggle="switch">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="note" class="control-label col-sm-2">角色描述</label>
                                        <div class="col-sm-3">
                                            <textarea class="form-control" id="note" name="note" rows="3"></textarea>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="auth" class="control-label col-sm-2">权限选择</label>
                                        <div class="col-sm-9">
                                            <div class="col-sm-10">
                                                <div class="row">
                                                    {volist name="rule_list" id="item_father"}
                                                    <div class="panel panel-success">
                                                        <div class="panel-heading form-inline">
                                                            <label>
                                                                <input name="rules[]" class="ace ace-checkbox-2 father"
                                                                       type="checkbox" value="{$item_father.id}"/>
                                                                <span class="lbl"> {$item_father.title} </span>
                                                            </label>
                                                            <span class="tools pull-right">
                                                                <a href="javascript:;" class="fa fa-chevron-down"></a>
                                                            </span>
                                                        </div>


                                                        {if condition="!empty($item_father.children)"}
                                                        <div class="panel-body panel-border">
                                                            {volist name="item_father.children" id="item_son"}
                                                            <label class="col-xs-2 w-160">
                                                                <input name="rules[]"
                                                                       class="ace ace-checkbox-2 children"
                                                                       type="checkbox" value="{$item_son.id}"/>
                                                                <span class="lbl"> {$item_son.title} </span>
                                                            </label>
                                                            {if condition="!empty($item_son.children)"}
                                                            {volist name="item_son.children" id="item_grandson"}
                                                            <label class="col-xs-2 w-160">
                                                                <input name="rules[]"
                                                                       class="ace ace-checkbox-2 children"
                                                                       type="checkbox" value="{$item_grandson.id}"/>
                                                                <span class="lbl"> {$item_grandson.title} </span>
                                                            </label>
                                                            {/volist}
                                                            {/if}
                                                            {/volist}
                                                        </div>
                                                        {/if}
                                                    </div>
                                                    {/volist}
                                                </div>

                                            </div>

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <input type="hidden" name="id" id="id" value="0">
                                        <div class="col-sm-offset-2 col-sm-10">
                                            <button class="btn btn-primary" type="submit">保存</button>
                                            <button class="btn btn-default" type="reset">重置</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
            <!-- END ROW  -->
        </section>
        <!-- END WRAPPER  -->
    </section>
    <!-- END MAIN CONTENT -->
    <!-- BEGIN FOOTER -->
    {include file="public/footer"}
    <!-- END FOOTER -->
</section>
<!-- END SECTION -->
<!-- BEGIN JS -->
{include file="public/js"}
<script src="__STATIC__/js/yunadmin/group.js"></script>
<!-- YunAdmin GROUP JS -->
<!-- END JS -->
</body>

</html>